﻿#ifndef VIDEODECODE_H
#define VIDEODECODE_H

#include <QThread>

extern "C"{
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
}

class ioQueue;

class videoDecodePrivate {
public:

    bool isExit = true;
    int streamIndex = -1;

    AVCodecContext  *cc  = NULL;
    AVPacket        *pkt = NULL;
    ioQueue         *queue = NULL;
};

class decodeBase : public QThread
{
    Q_OBJECT
public:
    explicit decodeBase(QObject *parent = 0);
	~decodeBase();

    void setCodecContext(AVCodecContext *cc);
    void setIoQueue(ioQueue *queue);
    void setStreamIndex(int index);
    void stopDecode();

protected:
    virtual void run() = 0;

signals:

public slots:

protected:
    videoDecodePrivate *d;
};

#endif // VIDEODECODE_H
